package com.yanqu.road.logic.activity.foxcard.game.effect;

import com.yanqu.road.entity.activity.foxcard.FoxBaseCard;
import com.yanqu.road.entity.activity.foxcard.FoxHandCard;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

import java.util.Collections;
import java.util.List;

/**
 * 减手牌上限或弃牌次数，但增加筹码/倍率
 * 筹码/乘算筹码/倍率/乘算倍率/减少的手牌上限/减少的弃牌次数
 */
public class FoxCardEffect17 extends FoxCardEffectBase {
    @Override
    protected void effectHandle(FoxCardGameLogic gameLogic, FoxHandCard handCard) {
        int addBaseScore = Integer.valueOf(effectConfig.getParamsList().get(0));
        int addBaseScoreMulti = Integer.valueOf(effectConfig.getParamsList().get(1));
        int addBaseMulti = Integer.valueOf(effectConfig.getParamsList().get(2));
        int addBaseMultiMulti = Integer.valueOf(effectConfig.getParamsList().get(3));
        int decHandCardLimit = Integer.valueOf(effectConfig.getParamsList().get(4));
        int decDropCardTimes = Integer.valueOf(effectConfig.getParamsList().get(5));

        if (triggerType == eFoxCardTriggerType.ADD && handCard == null) {
            gameLogic.reCalcCardOpTimes();
        } else if (triggerType == eFoxCardTriggerType.REMOVE) {
            gameLogic.reCalcCardOpTimes();
        } else if (triggerType == eFoxCardTriggerType.AFTER_SCORE) {
            List<FoxBaseCard> foxEffectCards = Collections.singletonList(effectCard);
            if (addBaseScore > 0) {
                gameLogic.addBaseScore(addBaseScore, foxEffectCards, null);
            }
            if (addBaseScoreMulti > 0) {
                gameLogic.addBaseScoreMulti(addBaseScoreMulti, foxEffectCards, null);
            }
            if (addBaseMulti > 0) {
                gameLogic.addBaseMulti(addBaseMulti, foxEffectCards, null);
            }
            if (addBaseMultiMulti > 0) {
                gameLogic.addBaseMultiMulti(addBaseMultiMulti, foxEffectCards, null);
            }
        }
    }
}
